/**
 * Author:yuiop
 * Date:2022/10/20 10:28
 */
package com.devops.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.devops.admin.model.DOSProjectWebhook;
import com.devops.admin.model.TableResult;
import com.devops.admin.po.DOSWebhookCustomInfoPo;
import com.devops.admin.po.DOSWebhookInfoPo;
import com.devops.admin.vo.DOSPageVo;
import com.devops.admin.vo.DOSWebhookCustomInfoVo;
import com.devops.admin.vo.DOSWebhookInfoVo;

import java.util.List;

public interface DOSProjectWebhookService extends IService<DOSProjectWebhook> {

    /**
     * 保存webhook
     * @param webhook
     * @return
     */
    boolean saveWebhook(DOSProjectWebhook webhook);

    /**
     * 更新webHook
     * @param webhookInfo
     * @return
     */
    boolean updateWebhook(DOSProjectWebhook webhookInfo);

    /**
     * 分页查询webHook
     * @param webhook
     * @return
     */
    TableResult<DOSWebhookInfoPo> getWebhookPage(DOSProjectWebhook webhook, DOSPageVo pageVo);

    /**
     * @Author heyabo
     * @Description 测试webhook是否能够连通
     * @Date 15:15 2022/11/8
     * @Param [webhook]
     * @return java.lang.String
     **/
    String testWebhook(DOSProjectWebhook webhook);

    /**
     * @Author heyabo
     * @Description 删除webhook
     * @Date 16:22 2022/11/16
     * @Param [id]
     * @return boolean
     **/
    boolean deleteWebhookById(Integer id);

    /**
     * @Author heyabo
     * @Description //TODO
     * @Date 08:49 2023/1/9
     * @Param [projectId]
     * @return java.util.List<com.devops.admin.po.DOSWebhookCustomInfoPo>
     **/
    List<DOSWebhookCustomInfoPo> getWebhookAndCustom(Integer projectId,Integer clusterId);
}
